import { Button } from "antd";
import "@manycore/miniapp-sdk";
import { useRequest } from "ahooks";

export default function HomePage() {
  const userRequest = useRequest(async () => {
    return Manycore.User.getUserAsync();
  }, { manual: true });

  return (
    <div>
      <div>
        userId: {userRequest.data?.userId}
      </div>
      <Button type="primary" onClick={() => userRequest.run()}>
        获取用户信息
      </Button>
    </div>
  );
}
